<template>
  <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" class="all">
    <van-collapse v-model="activeNames">
      <van-collapse-item v-for="(item,index) in list" :key="item.job_name" :title="item.job_name" :name="index">
        创建时间:{{item.created_at}}
      </van-collapse-item>
      
    </van-collapse>
  </van-list>
</template>

<script>
  import {
    JobService
  } from '@/api'
  export default {
    data() {
      return {
        list: [],
        loading: false,
        finished: false,
        activeNames: [0],
      };
    },
    methods: {
      onLoad() {
        // 异步更新数据
        // setTimeout 仅做示例，真实场景中一般为 ajax 请求
        JobService.getList().then(res => {
          this.list = res.data.data
          this.finished = true
        })

      },
    },
  };
</script>

<style lang="less" scoped>
  .all {
    padding: 24px 0;
    background-color: #f3f5f7;
    height: 100%;
  }
</style>